<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

	<!--添加需要搜索的工具  -->
	<div id="huotb5" style="padding: 5px; height: auto">
		<div>
			<a id="huoadd5" href="javascript:void(0)" class="easyui-linkbutton"
				data-options="iconCls:'icon-add',plain:true">添加</a> 
			<a id="huoedit5" href="javascript:void(0)" class="easyui-linkbutton"
				data-options="iconCls:'icon-edit',plain:true" >编辑</a>	
			<a href="javascript:void(0)" class="easyui-linkbutton"
				data-options="iconCls:'icon-remove',plain:true" onclick="removeit()">删除</a>
			<sapn style="margin-left:45%">搜索文本：</sapn>
			<input class="easyui-numberbox easyui-searchbox"
				data-options="searcher:searchname,prompt:'请输入需要搜索的员工编号'"
				style="width: 25%">
		</div>
	</div>
	
	<table id="huodg5" class="easyui-datagrid" ></table>
	<div id="huodd5" class="easyui-datagrid" style="width: 600px; height: 400px"
		data-options="modal:true,closed:true,title:'修改申请'">
			<div id="holidaybody" style="margin:2% 20%">
			<input class="easyui-textbox " type="hidden" style="display:none" id="applyId"/><br>
				<label>员工编号:</label> 
				<input  id="getemp" class="easyui-combobox holidaytext" style="disabled:true"/><br>
				<label>事务类型:</label> 
				<input  id="holidayType" class="easyui-combobox holidaytext" style="disabled:true"/><br>
				<label for="dname">原&nbsp &nbsp&nbsp&nbsp&nbsp因:</label>
				<textarea rows="10" cols="30" class=" holidaytext" id="reason" style="height:50px"></textarea><br>
		         <div>开始日期:<input id="beginTime" class="easyui-datebox holidaytext"></div>  
			     <div style="margin:2% 0">结束日期:<input id="endTime" class="easyui-datebox holidaytext"><br></div>
				<form id="upload" enctype="multipart/form-data" method="post" action="../up/upload">
			    <input type="file" name="uploadFile"/>
			    <input type="hidden" name="id" value="12"/>
			    <input type="button" value="文件凭证上传" onclick="doUpload()"/>
				</form> 
			</div>
	</div>
	
	

	<!-- 弹出新增窗口代码结束 -->
	<div id="back" class="easyui-dialog"
		style="width: 600px; height: 300px"
		data-options="modal:true,closed:true,title:'添加未通过原因'">
		<form id="ff2" method="post" action="addemp">
			<div id="holidaybody" style="margin: 5% 20%">
				<label for="dname">备 &nbsp &nbsp&nbsp&nbsp注:</label>
				<textarea rows="5" cols="20" class="holidayremaker"></textarea>
				<br>
			</div>
		</form>
	</div>
	
	<div id="hyn_window" class="easyui-window">
		<input id="hyn_datebox" type="text" class="easyui-datebox"/>
		<input type="text" class="easyui-textbox"/>
	</div>
		<script src="../hyn/js/check/checkAffairApply.js"></script>
		<script type="text/javascript">
		$("#hyn_window").window({
			width:'500',
			height:'200',
			closed:true
		});
		$("#beginTime").datebox({
			
		})
		$("#endTime").datebox({
			
		})
		$("#fileDocuments").filebox({
			
		})
		$("#huoadd5").bind('click',function() {
			addTab("添加申请","../check/checkAddAffairApply");
	     })
	     
		// 定义底部保存，清空，取消按钮
		$('#huodd5').dialog({
			buttons : [ {
				text : '保存',
				iconCls : 'icon-save',
				handler : function() {
					$('#ff').form('submit', {
						onSubmit : function(param) {
							var applyId=$("#applyId").val();
							var empId=$("#getemp").val();
							var holidayType=$('#holidayType').combobox("getText");
							var reason=$("#reason").val();
							var beginTime=$("#beginTime").val();
							var endTime=$("#endTime").val();
							var applys = [];
							var maker='huohuo';
							var apply = {
									applyId : applyId,
									empId : empId,
									holidayType : holidayType,
									reason : reason,
									beginTime : beginTime,
									endTime : endTime,
									maker:maker
								};
							    applys.push(apply);
								var jsondata = JSON.stringify(applys);
							$.ajax({
								url : "../check/updateAffairApply",
								data : {"jsondata" : jsondata},
								success : function(e) {
									if (e == "ok") {
										alert("修改成功");
						               $('#huodg5').datagrid('load');
									}
								}
							});
						},
						success : function(data) {

						}
					});
				}
			}, {
				text : '清空',
				iconCls : 'icon-clear',
				handler : function() {
					$('#ff').form('clear');
				}
			}, {
				text : '取消',
				iconCls : 'icon-cancel',
				handler : function() {
					$("#huodd5").window("close");
				}
			} ]
		});
		</script>
</body>
</html>